package com.wantyx.creation.singleton;

/**
 * 作者 : wantyx
 * 创建时间 : 2023/11/1
 * 实现功能 :
 */
public class SingletonLazy {
    private static SingletonLazy singletonLazy;

    private SingletonLazy(){}

    public static SingletonLazy getInstance(){
        if (singletonLazy == null){
            synchronized (SingletonLazy.class){
                if (singletonLazy == null){
                    SingletonLazy instance = new SingletonLazy();
                    singletonLazy = instance;
                }
                return singletonLazy;
            }
        }
        return singletonLazy;
    }
}
